<?php
DEFINE('DB_USER', 'worldcup');
DEFINE('DB_PASSWORD', '123456');
DEFINE('DB_HOST', 'localhost');
DEFINE('DB_NAME', 'worldcup');

$dbc = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$dbc) {
  die('Could not to connect to Mysql:' . mysqli_connect_error());
}
mysqli_set_charset($dbc, 'utf8');

$teamGroupSql = "select distinct group_no from team;";
$groupAaary = mysqli_query($dbc, $teamGroupSql);

// 初始化一个空数组来存储所有行数据
$dataArray = array();
// 逐行提取数据并存入数组
while ($row = mysqli_fetch_assoc($groupAaary)) {
  $dataArray[] = $row['group_no'];
}
$response = array('status' => true, 'message' => '获取小组队伍成功', 'data' => $dataArray);
echo json_encode($response);